#include <iostream>
#include <string>
#include <regex>

int main()
{
    std::string str = "/numbers/1234";
    std::regex e("/numbers/(\\d+)");
    std::smatch matches;
    //结果放到matches里面
    bool ret = std::regex_match(str, matches, e);
    if(ret == false)
    {
        return -1;
    }
    //第一个字符串是原来的字符串，第二个是匹配的字符串1234
    for(auto& s : matches)
    {
        std::cout << s << std::endl;
    }
    return 0;
}